<!--
 * @Descripttion: 
 * @version: 
 * @Author: liwanpeng
 * @Date: 2020-05-13 15:08:17
 * @LastEditors: sueRimn
 * @LastEditTime: 2020-12-17 18:09:14
-->
<template>
  <div ref="gantt"></div>
</template>

<script>
import gantt from 'dhtmlx-gantt' // 引入模块
import 'dhtmlx-gantt/codebase/dhtmlxgantt.css'
import 'dhtmlx-gantt/codebase/locale/locale_cn' // 本地化
export default {
  name: 'gantt',
  props: {
    tasks: {
      type: Object,
      default() {
        return { data: [], links: [] }
      }
    }
  },

  mounted() {
    gantt.init(this.$refs.gantt)
    gantt.parse(this.$props.tasks)
  }
}
</script>

<style>
@import 'dhtmlx-gantt/codebase/dhtmlxgantt.css';
</style>
